import logging
import yagmail

def log_set():
    logging.basicConfig(filename='log.log',filemode='w',level=logging.DEBUG,format="%(asctime)s -- %(filename)s -- %(message)s")


def send_mail(file):
    mail=yagmail.SMTP(user="2179037145@qq.com",password="lzjrlbpnkfdbecii",host="smtp.qq.com",encoding="utf-8")
    mail.send(to="2179037145@qq.com",subject="测试报告",contents="今日报告，请查收",attachments=file)